﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Policlinica
{
    public class InsurancePolis : BusinessObjectBase
    {
        private string _series;
        private string _polisNumber;
        private DateTime _registration;
        private DateTime _expiration;
        private InsuranceOrganization _InsuranceOrganization;

        public InsurancePolis()
        {
            this._InsuranceOrganization = default(InsuranceOrganization);
        }

        public InsurancePolis(int id, bool isDeleted, string series, string polisNumber, DateTime registration,
            DateTime expiration, InsuranceOrganization insuranceOrganization):base(id, isDeleted)
        {
            _series = series;
            _polisNumber = polisNumber;
            _registration = registration;
            _expiration = expiration;
            _InsuranceOrganization = insuranceOrganization;
        }

        public InsurancePolis(string series, string polisNumber, DateTime registration,
            DateTime expiration, InsuranceOrganization insuranceOrganization)
        {
            _series = series;
            _polisNumber = polisNumber;
            _registration = registration;
            _expiration = expiration;
            _InsuranceOrganization = insuranceOrganization;
        }

        public string Series
        {
            get
            {
                return this._series;
            }
            set
            {
                if ((this._series != value))
                {
                    this._series = value;
                }
            }
        }

        public string PolisNumber
        {
            get
            {
                return this._polisNumber;
            }
            set
            {
                if ((this._polisNumber != value))
                {
                    this._polisNumber = value;
                }
            }
        }

        public DateTime Registration
        {
            get
            {
                return this._registration;
            }
            set
            {
                if ((this._registration != value))
                {
                    this._registration = value;
                }
            }
        }

        public DateTime Expiration
        {
            get
            {
                return this._expiration;
            }
            set
            {
                if ((this._expiration != value))
                {
                    this._expiration = value;
                }
            }
        }
        
        public InsuranceOrganization InsuranceOrganization
        {
            get
            {
                return this._InsuranceOrganization;
            }
            set
            {
                InsuranceOrganization previousValue = this._InsuranceOrganization;
                if (previousValue != value)
                {
                    
                    this._InsuranceOrganization = value;
                    
                }
            }
        }


        public override string ToString()
        {
            return Series + " " + PolisNumber + ", " + InsuranceOrganization.Name;
        }
      
    }
	
}
